<template>
	<view>
		<!-- 顶部导航栏 -->
		<u-navbar :is-back="false" title="游戏规则" :background="nav_bg" :borderBottom="false">
			<view class="slot-wrap" @tap="jump">
				<image :src="back_img" style="width: 48rpx; height: 48rpx;"></image>
			</view>
		</u-navbar>
		<view class="content">
			<view class="main" v-for="(list, index) in rule_text" :key="index">
				<view class="title">{{index + 1}}、{{list.name}}</view>
				<view class="content_rule" v-for="(item, index) in list.rule">
					<view class="rule">{{item.rule}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				back_img: this.imgUrl + 'back.png',
				nav_bg: {
					background: '#FDF8EE'
				},
				rule_text: []
			}
		},
		methods: {
			jump() {
				this.$Router.back(1)
			}
		},
		onLoad() {
		    this.$api('game.rule').then(res => {
		        this.rule_text = res.data;
		    })
		}
	}
</script>
<style>
	page {
		background: linear-gradient(#FDF8EE, #F8F8FB);
	}
</style>
<style lang="scss" scoped>
	@import './index.scss';
</style>
